home *** CD-ROM | disk | FTP | other *** search
- /* main.c
-
- Demo program code for measuring luminance using the Minolta LS-110/100 luminance
- meters.
- If there's no meter attached to the computer, the program will simply give a
- message that there was no data available within a certain period.
-
- Please send suggestions, bugs, improvements, comments to f.w.cornelissen@med.rug.nl
- Details in "read me" file and luminance.c file. Use at your own risk.
-
- 26-02-97 fwc created it
- */
-
- #if __MWERKS__
- #include "SIOUX.h"
- #endif
-
- #include "luminanceMeter.h"
-
- #define PORT PRINTER_PORT // set to PRINTER_PORT or MODEM_PORT
-
- void main( void );
- void changeConsoleSettings( void );
- void wait( double sec );
-
- void main( void )
- {
- int i = 0;
- double lum=0;
- char text[ 256 ];
- EventRecord event;
-
- changeConsoleSettings( );
- printf( "\nTest Program for Minolta LS110 Luminance meter\n" );
-
- printf( "Program set for use with %s.\n", returnPortName( PORT ) );
- printf( "\n Click the mouse or hit a key to continue......\n" );
-
- FlushEvents( everyEvent, 0 );
- while( !EventAvail(keyDownMask+mDownMask, &event ) ) ;
-
- printf( "\n Initiating luminance meter\n" );
- initLuminanceMeter( PORT );
- printf( "\nStarting measurements.\n");
- printf( "\n Click the mouse or hit a key to stop......\n\n" );
- FlushEvents( everyEvent, 0 );
- while( !EventAvail(keyDownMask+mDownMask, &event ) )
- {
- if( getLuminance( &lum, text ) ) // no error
- printf( "Nr: % d, lum: % 6.2f, %s\n", i++, lum, text );
- else // error
- printf( "Nr: %d, message: %s\n", i++, text );
- }
-
- endLuminanceMeter();
- printf( "\nSession finished, goodbye\n" );
-
- }
-
-
-
-
-
-
- void changeConsoleSettings( void )
- {
- #if __MWERKS__
- SIOUXSettings.toppixel=LMGetMBarHeight()+19; // allow for menu bar and title bar
- SIOUXSettings.leftpixel=1;
- SIOUXSettings.rows=40;
- SIOUXSettings.columns=(qd.screenBits.bounds.right)/(SIOUXSettings.fontsize*5/4)-1;
- SIOUXSettings.autocloseonquit=0;
- SIOUXSettings.showstatusline=0;
- SIOUXSettings.asktosaveonclose=0;
- printf("\n");
- #endif
- }
-